<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('公民基础信息列表')"/>
</head>
<body class="gray-bg">
<div class="container-div">
    <div class="row">
        <div class="col-sm-12 search-collapse">
            <form id="formId">
                <div class="select-list">
                    <ul>
                        <li>
                            <label>姓名：</label>
                            <input type="text" name="name"/>
                        </li>
                        <li>
                            <label>出生年月：</label>
                            <input type="text" name="birthday"/>
                        </li>
                        <li>
                            <label>出生地：</label>
                            <input type="text" name="birthplace"/>
                        </li>
                        <li>
                            <label>身份证号：</label>
                            <input type="text" name="idCard"/>
                        </li>
                        <li>
                            <label>违法内容：</label>
                            <input type="text" name="labelName"/>
                        </li>
                        <li>
                            <label>是否已婚：</label>
                            <input type="text" name="marrige"/>
                        </li>
                        <li>
                            <label>兵役情况：</label>
                            <input type="text" name="escu"/>
                        </li>
                        <li>
                            <label>民族：</label>
                            <input type="text" name="nation"/>
                        </li>
                        <li>
                            <label>籍贯：</label>
                            <input type="text" name="hhplace"/>
                        </li>
                        <li>
                            <label>现住址：</label>
                            <input type="text" name="nplace"/>
                        </li>
                        <li>
                            <label>专业：</label>
                            <input type="text" name="profressional"/>
                        </li>
                        <li>
                            <label>学历：</label>
                            <input type="text" name="edegree"/>
                        </li>
                        <li>
                            <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i
                                    class="fa fa-search"></i>&nbsp;搜索</a>
                            <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i
                                    class="fa fa-refresh"></i>&nbsp;重置</a>
                        </li>
                    </ul>
                </div>
            </form>
        </div>

        <div class="btn-group-sm" id="toolbar" role="group">
            <a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="system:personinfo:add">
                <i class="fa fa-plus"></i> 添加
            </a>
            <a class="btn btn-primary single disabled" onclick="$.operate.edit()"
               shiro:hasPermission="system:personinfo:edit">
                <i class="fa fa-edit"></i> 修改
            </a>
            <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()"
               shiro:hasPermission="system:personinfo:remove">
                <i class="fa fa-remove"></i> 删除
            </a>
            <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="system:personinfo:export">
                <i class="fa fa-download"></i> 导出
            </a>
           <!--  <a class="btn btn-primary" onclick="uploadInfo()" >
                 <i class="fa fa-upload"></i> 导入基础数据数据
             </a>-->
          <!--  <a class="btn btn-danger" onclick="uploadInfoTelOrAddress()" >
                <i class="fa fa-upload"></i> 导入电话和地址信息
            </a>-->
            <a class="btn btn-warning" onclick="uploadInfoCase()" >
                <i class="fa fa-upload"></i> 导入案件信息
            </a>
        </div>
        <div class="col-sm-12 select-table table-striped">
            <table id="bootstrap-table"></table>
        </div>
    </div>
</div>
<th:block th:include="include :: footer"/>
<script th:inline="javascript">
    var editFlag = [[${@permission.hasPermi('system:personinfo:edit')}]];
    var removeFlag = [[${@permission.hasPermi('system:personinfo:remove')}]];
    var prefix = ctx + "system/personinfo";

    $(function () {
        var options = {
            url: prefix + "/list",
            createUrl: prefix + "/add",
            updateUrl: prefix + "/edit/{id}",
            removeUrl: prefix + "/remove",
            exportUrl: prefix + "/export",
            modalName: "公民基础信息",
            columns: [{
                checkbox: true
            },
                {
                    field: 'id',
                    title: '',
                    visible: false
                },
                {
                    field: 'bussinessId',
                    title: '业务ID',
                    visible: false
                },
                {
                    field: 'name',
                    title: '姓名'
                },
                {
                    field: 'sex',
                    title: '性别'
                },
                {
                    field: 'age',
                    title: '年龄'
                },
                {
                    field: 'idCard',
                    title: '身份证号'
                },
                {
                    field: 'birthday',
                    title: '出生年月'
                },
                {
                    field: 'birthplace',
                    title: '出生地'
                },
                {
                    field: 'hhplace',
                    title: '籍贯'
                },
                {
                    field: 'nplace',
                    title: '现住址'
                },
                {
                    field: 'nation',
                    title: '民族'
                },
                {
                    field: 'height',
                    title: '身高'
                },
                {
                    field: 'marrige',
                    title: '是否已婚'
                },
                {
                    field: 'reli',
                    title: '宗教信仰'
                },
                {
                    field: 'escu',
                    title: '是否服过兵役'
                },
                {
                    field: 'profressional',
                    title: '专业'
                },
                {
                    field: 'labelName',
                    title: '违法内容'
                },
                {
                    field: 'edegree',
                    title: '学历'
                },

                {
                    title: '操作',
                    align: 'center',
                    formatter: function (value, row, index) {
                        var actions = [];
                        actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a> ');
                        actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a>');
                        return actions.join('');
                    }
                }]
        };
        $.table.init(options);
    });


    function uploadInfo() {
        $.ajax({
            url: prefix + "/uploadInfo",
            async: true,
            type: 'post',
            dataType: 'json',
            success: function (res) {

            }
        })
    }


    function uploadInfoTelOrAddress() {
        $.ajax({
            url: prefix + "/uploadInfoTelOrAddress",
            async: true,
            type: 'post',
            dataType: 'json',
            success: function (res) {

            }
        })
    }



    function uploadInfoCase() {
        $.ajax({
            url: prefix + "/uploadInfoCase",
            async: true,
            type: 'post',
            dataType: 'json',
            success: function (res) {

            }
        })
    }
</script>
</body>
</html>